#include "ws2812b_core.h"

void example_5(COLOR *buf, uint16_t buf_len, uint16_t *stept)
{
    uint16_t lstept = *stept;
    static uint8_t state = 0;

    for(uint8_t i=0; i<buf_len; i++){
        buf[i].r = 0;
        buf[i].g = 0;
        buf[i].b = 0;
    }

    switch(state)
    {
        case 0:
            buf[lstept].r = 0X1F;
            state = 1;
        break;
        case 1:
            buf[lstept].g = 0X1F;
            state = 2;
        break;
        case 2:
            buf[lstept].b = 0X1F;
            state = 0;
        break;

        default:
        break;
    }

    if(*stept < buf_len-1){
        (*stept)++;
    }
    else{
        (*stept)=0;
    }
}



